﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using System.Data.SqlClient;

namespace LotteCinema.DAO
{
    public class DDangNhap: KetNoiCSDL
    {
        #region Kiểm Tra Đăng Nhập
        public DataTable KiemTraDangNhap(CDangNhap cdn)
        {
            using (SqlCommand cmd = new SqlCommand("SP_DANGNHAP_NHANVIEN", LayKetNoi()))
            {
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add(new SqlParameter("@MANV", cdn._tenDangNhap));
                cmd.Parameters.Add(new SqlParameter("@MATKHAU", cdn._matKhau));
                SqlDataAdapter da = new SqlDataAdapter(cmd);
                DataTable dt = new DataTable();
                da.Fill(dt);
                //if (dt.Rows.Count >= 1)
                //{
                //    return dt.Rows[0]["QUYEN"].ToString();
                //}
                //else
                //{
                //    return "";
                //}
                return dt;
            }
        }
        #endregion 
    }
}

